<template>
  <div>
    <div v-for="item in films" :key="item.filmId">
      <p>
        <router-link :to="'/filmList/'+item.filmId">{{item.name}}</router-link>
      </p>
      <hr />
    </div>
    <router-view />
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "FilmList",
  data () {
    return {
      films: []
    }
  },
  mounted () {
    axios.get("https://m.maizuo.com/gateway", {
      headers: {
        "X-Client-Info": '{"a":"3000","ch":"1002","v":"5.2.1","e":"17026209561814756826546177"}',
        "X-Host": "mall.film-ticket.film.list"
      },
      params: {
        cityId: 110100,
        pageNum: 1,
        pageSize: 3,
        type: 2
      }
    }).then(value => {
      this.films = value.data.data.films;
    })
  }
}
</script>

<style scoped>
</style>